Due to typecasting being done when converting floats to integers in
gnome-settings-daemon, a volume of 0.9% in g-s-d will end up as 0% in
gnome-shell. This can lead to a mismatch of icons between the volume OSD
(the icon to use is determined by g-s-d itself) and the shells own
volume indicator (the icon to use is determined by the shell using the
volume received from g-s-d).
To fix this, simply get rid of the conversion from float to percentage
in g-s-d and back to floats in the shell and just send a float/double
value on DBus.
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/78
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385
if (serializedIcon)
icon = Gio.Icon.new_for_string(serializedIcon);
- // Translate from percentages in the D-Bus API to floats
- if (!isNaN(level))
- level /= 100;
- if (!isNaN(maxLevel))
- maxLevel /= 100;
-
Main.osdWindowManager.show(monitorIndex, icon, label, level, maxLevel);
}